import http from './request'
/*****************************隐患整改 *********************************************************/

//获取数据
export const hazardreportnew = (data,current,size) => {
    return http({
        url: '/hongyun-training/hazardreportnew/list?current='+current+'&size='+size,
        method: 'POST',
        data
    })
}
//获取考核数据
export const hazardreportnewsubmit = (data) => {
    return http({
        url: '/hongyun-training/hazardreportnew/submit',
        method: 'POST',
        data
    })
}
//详情
export function hazardreportnewId(id){
    return http({
        url: '/hongyun-training/hazardreportnew/detail?id='+id,
        // url: '/mobile/equipmentrepair/detail?id='+id,
        method: 'GET',
    })
}
//批量导出
export const hazardreportnewexport = (data) => {
    return http({
        url: '/hongyun-training/hazardreportnew/exportByIds',
        method: 'POST',
        data
    })
}
/*****************************应急预案 *********************************************************/
//获取数据
export function getSchemes(data){
    return http({
        url: '/hongyun-training/scheme/getSchemes',
        method: 'POST',
        data
    })
}
//新增修改应急预案
export function operateScheme(data){
    return http({
        url: '/hongyun-training/scheme/operateScheme',
        method: 'POST',
        data
    })
}
//详情
export function getSchemeInfo(id){
    return http({
        url: '/hongyun-training/scheme/getSchemeInfo?id='+id,
        method: 'GET',
    })
}
//删除
export const deleteScheme = (id) => {
    return http({
        url: `/hongyun-training/scheme/deleteScheme/${id}`,
        method: 'DELETE'
    })
}
//新建时的预案列表
export const getSchemeInitList = () => {
    return http({
        url: '/hongyun-training/scheme/getSchemeInitList',
        method: 'GET',
    })
}
//编辑时的预案列表
export const getSchemeList = () => {
    return http({
        url: '/hongyun-training/scheme/getSchemeList',
        method: 'GET',
    })
}
/*****************************应急预案脚本 *********************************************************/
//获取数据
export function getScriptPage(data){
    return http({
        url: '/hongyun-training/script/getScriptPage',
        method: 'POST',
        data
    })
}
//新增修改应急预案
export function operateScript(data){
    return http({
        url: '/hongyun-training/script/operateScript',
        method: 'POST',
        data
    })
}
//详情
export function getScriptInfo(id){
    return http({
        url: '/hongyun-training/script/getScriptInfo?id='+id,
        method: 'GET',
    })
}
//删除
export const deleteScript = (id) => {
    return http({
        url: `/hongyun-training/script/deleteScript/${id}`,
        method: 'DELETE'
    })
}
/*****************************预案演练 *********************************************************/
//获取数据
export function getDrills(data){
    return http({
        url: '/hongyun-training/drill/getDrills',
        method: 'POST',
        data
    })
}
//新增修改应急预案
export function operateDrill(data){
    return http({
        url: '/hongyun-training/drill/operateDrill',
        method: 'POST',
        data
    })
}
//详情
export function getDrillInfo(id){
    return http({
        url: '/hongyun-training/drill/getDrillInfo?id='+id,
        method: 'GET',
    })
}
//删除
export const delDrill = (id) => {
    return http({
        url: `/hongyun-training/drill/delDrill/${id}`,
        method: 'DELETE'
    })
}
//脚本列表
export const getScripts = () => {
    return http({
        url: '/hongyun-training/script/getScripts',
        method: 'GET',
    })
}
/*****************************预案演练记录 *********************************************************/
//获取数据
export function getDrillRecords(data){
    return http({
        url: '/hongyun-training/record/getDrillRecords',
        method: 'POST',
        data
    })
}
//新增修改应急预案
export function operaterecord(data){
    return http({
        url: '/hongyun-training/record/operateRecord',
        method: 'POST',
        data
    })
}
//详情
export function getrecordInfo(id){
    return http({
        url: '/hongyun-training/record/getRecordInfo?id='+id,
        method: 'GET',
    })
}
//删除
export const delDrillrecord = (id) => {
    return http({
        url: `/hongyun-training/record/delRecord/${id}`,
        method: 'DELETE'
    })
}
/*****************************预案演练复盘 *********************************************************/
//获取数据
export function getReplays(data){
    return http({
        url: '/hongyun-training/record/getReplays',
        method: 'POST',
        data
    })
}
//新增修改应急预案
export function operateReplay(data){
    return http({
        url: '/hongyun-training/record/operateReplay',
        method: 'POST',
        data
    })
}
//详情
export function getReplayInfo(id){
    return http({
        url: '/hongyun-training/record/getReplayInfo?id='+id,
        method: 'GET',
    })
}
//删除
export const delReplay = (id) => {
    return http({
        url: `/hongyun-training/record/delReplay/${id}`,
        method: 'DELETE'
    })
}
//获取演练名称
export const getDrillList = (type) => {
    return http({
        url: '/hongyun-training/drill/getDrillList?type='+type,
        method: 'GET',
    })
}
/*****************************巡检管理 *********************************************************/
/*****************************巡检项 **********************************/
//获取数据
export function getInspectionitemsList(data, current, size){
    return http({
        url: '/hongyun-training/inspectionitems/list?current=' + current + '&size=' + size,
        method: 'POST',
        data
    })
}
//删除
export const inspectionitemsremove = (ids) => {
    return http({
        url: '/hongyun-training/inspectionitems/remove?ids='+ids,
        method: 'POST',
    })
} 
//编辑提交
export function inspectionitemsSubmit(data){
    return http({
        url: '/hongyun-training/inspectionitems/submit',
        method: 'POST',
        data
    })
}
//详情
export function inspectionitemsdetail(id){
    return http({
        url: '/hongyun-training/inspectionitems/detail?id='+id,
        method: 'GET',
    })
}
/*****************************巡检点 **********************************/
//获取数据
export function getInspectionpointsList(data, current, size){
    return http({
        url: '/hongyun-training/inspectionpoints/list?current=' + current + '&size=' + size,
        method: 'POST',
        data
    })
}
//删除
export const inspectionpointsremove = (ids) => {
    return http({
        url: '/hongyun-training/inspectionpoints/remove?ids='+ids,
        method: 'POST',
    })
} 
//编辑前判断是否关联
export const existAssociatedData = (id) => {
    return http({
        url: '/hongyun-training/inspectionpoints/existAssociatedData?id='+id,
        method: 'POST',
    })
} 
//编辑提交
export function inspectionpointsSubmit(data){
    return http({
        url: '/hongyun-training/inspectionpoints/submit',
        method: 'POST',
        data
    })
}
//详情
export function inspectionpointsdetail(id){
    return http({
        url: '/hongyun-training/inspectionpoints/detailById?id='+id,
        method: 'GET',
    })
}
//根据设备分类获取设备
export function deviceInfosByTypeId(typeId){
    return http({
        url: '/hongyun-training/inspectionpoints/deviceInfosByTypeId?typeId='+typeId,
        method: 'GET',
    })
}
/*****************************巡检计划 **********************************/
//获取数据
export function getInspectionplanList(data, current, size){
    return http({
        url: '/hongyun-training/inspectionplan/list?current=' + current + '&size=' + size,
        method: 'POST',
        data
    })
}
//删除
export const inspectionplanremove = (ids) => {
    return http({
        url: '/hongyun-training/inspectionplan/remove?ids='+ids,
        method: 'POST',
    })
} 
//编辑前校验是否关联
export const existAssociatedDataplan = (id) => {
    return http({
        url: '/hongyun-training/inspectionplan/existAssociatedData?id='+id,
        method: 'POST',
    })
} 
//编辑提交
export function inspectionplanSubmit(data){
    return http({
        url: '/hongyun-training/inspectionplan/submit',
        method: 'POST',
        data
    })
}
//详情
export function inspectionplandetail(id){
    return http({
        url: '/hongyun-training/inspectionplan/detail?id='+id,
        method: 'GET',
    })
}
/*****************************巡检任务 **********************************/
//获取数据
export function getInspectiontasksnList(data, current, size){
    return http({
        url: '/hongyun-training/inspectiontasks/list?current=' + current + '&size=' + size,
        method: 'POST',
        data
    })
}
//删除
// export const inspectiontasksremove = (ids) => {
//     return http({
//         url: '/hongyun-training/inspectiontasks/remove?ids='+ids,
//         method: 'POST',
//     })
// }
//详情
export function inspectiontasksdetail(id){
    return http({
        url: '/hongyun-training/inspectiontasks/detail?id='+id,
        method: 'GET',
    })
}
/*****************************巡检排班表 **********************************/
//获取数据
export function inspectionscheduleList(data, current, size){
    return http({
        url: '/api/inspectionschedule/list?current=' + current + '&size=' + size,
        method: 'POST',
        data
    })
}
// 删除
export const inspectionscheduleremove = (ids) => {
    return http({
        url: '/api/inspectionschedule/remove?ids='+ids,
        method: 'POST',
    })
}
//编辑提交
export function inspectionscheduleSubmit(data){
    return http({
        url: '/api/inspectionschedule/submit',
        method: 'POST',
        data
    })
}
//详情
export function inspectionscheduledetail(id){
    return http({
        url: '/api/inspectionschedule/detail?id='+id,
        method: 'GET',
    })
}
/*****************************特殊作业 **********************************/
//配置信息
//获取数据
export function getJobConfigs(data){
    return http({
        url: '/hongyun-training/jobConfig/getJobConfigs',
        method: 'POST',
        data
    })
}
//新增修改应急预案
export function operateJobConfig(data){
    return http({
        url: '/hongyun-training/jobConfig/operateJobConfig',
        method: 'POST',
        data
    })
}
//删除
export const delJobConfig = (id) => {
    return http({
        url: `/hongyun-training/jobConfig/delJobConfig/${id}`,
        method: 'DELETE'
    })
}
//作业类型
export function getJobTypes(){
    return http({
        url: '/hongyun-training/jobConfig/getJobTypes',
        method: 'GET',
    })
}
//启用
export function jobConfigUse(data){
    return http({
        url: '/hongyun-training/jobConfig/jobConfigUse',
        method: 'PUT',
        data
    })
}
//获取八大作业
export function getJobNoNames(){
    return http({
        url: '/hongyun-training/jobConfig/getJobNoNames',
        method: 'GET',
    })
}
/*****************************安全作业票申请 **********************************/
export function getJobTicketsPage(data){
    return http({
        url: '/hongyun-training/jobTicket/getJobTicketsPage',
        method: 'POST',
        data
    })
}

//详情
export function getJobTicketInfo(id){
    return http({
        url: '/hongyun-training/jobTicket/getJobTicketInfo?id='+id,
        method: 'GET',
    })
}
//安全措施确认
export function getSafes(id){
    return http({
        url: '/hongyun-training/jobTicket/getSafes?jobId='+id,
        method: 'GET',
    })
}
//确认签字
export function getSigns(id){
    return http({
        url: '/hongyun-training/jobTicket/getSigns?jobId='+id,
        method: 'GET',
    })
}
//审批流程
export function getApprove(id,type){
    return http({
        url: '/hongyun-training/jobTicket/getApprove?jobId='+id+'&type='+type,
        method: 'GET',
    })
}
//作业过程详情
export function getJobProcessInfo(id){
    return http({
        url: '/hongyun-training/jobProcess/getJobProcessInfo?id='+id,
        method: 'GET',
    })
}
//查看安全交底确认信息
export function getJobDisclosure(id){
    return http({
        url: '/hongyun-training/jobTicket/getJobDisclosure?jobId='+id,
        method: 'GET',
    })
}
/*****************************委外单位 **********************************/
export function getJobDeptPage(data){
    return http({
        url: '/api/jobOutsource/getJobDeptPage',
        method: 'POST',
        data
    })
}
//删除
export const delJobDept = (id) => {
    return http({
        url: `/api/jobOutsource/delJobDept/${id}`,
        method: 'DELETE'
    })
}
//新增修改
export function operateJobDept(data){
    return http({
        url: '/api/jobOutsource/operateJobDept',
        method: 'POST',
        data
    })
}
//单位列表
export function getJobDeptList(){
    return http({
        url: '/api/jobOutsource/getJobDeptList',
        method: 'GET',
    })
}
/*****************************委外人员**********************************/
export function getJobUserPage(data){
    return http({
        url: '/api/jobOutsource/getJobUserPage',
        method: 'POST',
        data
    })
}
//删除
export const delJobUser = (id) => {
    return http({
        url: `/api/jobOutsource/delJobUser/${id}`,
        method: 'DELETE'
    })
}
//新增修改
export function operateJobUser(data){
    return http({
        url: '/api/jobOutsource/operateJobUser',
        method: 'POST',
        data
    })
}
//详情
export function getJobUserInfo(id){
    return http({
        url: '/api/jobOutsource/getJobUserInfo?id='+id,
        method: 'GET',
    })
}
//安全作业票统计分析
export function jobStatistics(data){
    return http({
        url: '/api/jobTicket/jobStatistics',
        method: 'POST',
        data
    })
}


/*****************************我的特殊作业**********************************/
export function getJobTicketsPageByUser(data){
    return http({
        url: '/api/jobTicket/getJobTicketsPageByUser',
        method: 'POST',
        data
    })
}